<!-- //我的待审核请假 -->
<template>
	<view class="viewBg">
		<view class="uni-padding-wrap uni-common-mt" v-for="(item,index) in askLeaveList" :key="index">
			<view class="uni-card">
				<view class="uni-card-content">
					<view class="uni-card-content-inner">
						<view class="leaveType">请假类型：{{item.leaveTypeName}}</view>
						<view class="createTime">申请时间：{{item.createTime}}</view>
						<view class="leaveTime">请假时间：{{item.leaveStart}}</view>
						<view class="leaveReason">请假原因：{{item.reason}}</view>
						<view class="status" :style="'color:'+ item.statusColor">{{item.status}}</view>
						
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				askLeaveList:[],
				pageNo:1,
			};
		},
		onLoad() {
			this.getList();
		},
		onPullDownRefresh() {
			this.pageNo = 1;
			this.askLeaveList = new Array();
			this.getList();
		},
		onReachBottom() {
			this.pageNo++;
			this.getList();
		},
		methods: {
			getList() {
				this.$http.get('ac/xagrid/appAttenceService/getMyAttenceAuditList',{pageNo:this.pageNo,pageSize:"10",type:"3",approvalStatus:1}).then((res)=>{
					uni.stopPullDownRefresh();
					var list = new Array();
					for (var i = 0;i < res.data.results.length;i++) {
						var dic = res.data.results[i];
						if(dic.approvalStatus === "0"){
							dic.status = "未审批";
							dic.statusColor = "#0FAEFF";
						}else if(dic.approvalStatus === "1"){
							dic.status = "审批通过";
							dic.statusColor = "#009830";
						}else if(dic.approvalStatus === "2"){
							dic.status = "审批不通过";
							dic.statusColor = "#EE0000";
						}
						console.log(JSON.stringify(dic)+"这里是");
						list.push(dic);

					}
					this.askLeaveList = this.askLeaveList.concat(list);
					console.log(JSON.stringify(this.askLeaveList));
				})
			}
		},
	}
</script>

<style>
.viewBg{
		width: 100%;
		height: 100%;
		
		/* background-color: #0FAEFF; */
	}
</style>
